"use strict";
exports.__esModule = true;
exports.canvasEvent = void 0;
// @ts-ignore //忽略提示
var html2canvas_esm_js_1 = require("./html2canvas.esm.js");
var canvasEvent = function (id, color) {
    if (id === void 0) { id = ''; }
    if (color === void 0) { color = '#fff'; }
    return new Promise(function (resolve, reject) {
        (0, html2canvas_esm_js_1["default"])(document.querySelector(id), {
            //允许图片跨域
            useCORS: true,
            taintTest: false,
            logging: true,
            //背景颜色
            backgroundColor: color
        }).then(function (canvas) {
            var url = canvas.toDataURL('image/png');
            resolve(url);
        })["catch"](function () { reject(); });
    });
};
exports.canvasEvent = canvasEvent;
